/**
 * 
 */
package com.axt.dbaudit.bean.cfg;

import java.util.List;
import com.axt.dbaudit.model.cfg.AlertCfg;
import com.axt.soa.bean.BaseFuncBean;
import com.axt.dbaudit.base.*;
import com.axt.soa.msg.types.MsgParam;


public class AlertCfgBean extends BaseFuncBean{
	/**
	 * queryAlertCfg
	 */
	public List<AlertCfg> queryAlertCfg(String serverPath)
	{
		prepare(serverPath);
		
		return fetch(
				MsgFuncExt.FUNC_QUERY_ALERT_CFG, 
				"com.axt.dbaudit.model.cfg.AlertCfg",
				"AlertCfg", CONN_T_TCP);
	}
	
	/**
	 * updateAlertCfg
	 */
	public int updateAlertCfg(String serverPath, AlertCfg alertCfg){
		prepare(serverPath);
		
		request.addParam(MsgParam.MSG_COL_AU_ISENABLEEMAILALERT,alertCfg.getAu_isEnableEmailAlert());
		request.addParam(MsgParam.MSG_COL_AU_EHIGHRISK, alertCfg.getAu_eHighRisk());
		request.addParam(MsgParam.MSG_COL_AU_EMIDDLERISK, alertCfg.getAu_eMiddleRisk());
		request.addParam(MsgParam.MSG_COL_AU_ELOWRISK, alertCfg.getAu_eLowRisk());
		request.addParam(MsgParam.MSG_COL_AU_ALERTINTERVAL, alertCfg.getAu_alertInterval());
		request.addParam(MsgParam.MSG_COL_AU_ISENABLEBUBBLEALERT, alertCfg.getAu_isEnableBubbleAlert());
		request.addParam(MsgParam.MSG_COL_AU_BHIGHRISK, alertCfg.getAu_bHighRisk());
		request.addParam(MsgParam.MSG_COL_AU_BMIDDLERISK, alertCfg.getAu_bMiddleRisk());
		request.addParam(MsgParam.MSG_COL_AU_BLOWRISK, alertCfg.getAu_bLowRisk());
		request.addParam(MsgParam.MSG_COL_AU_ISENABLESOUNDALERT, alertCfg.getAu_isEnableSoundAlert());
		request.addParam(MsgParam.MSG_COL_AU_FILEPATH, alertCfg.getAu_FilePath());
		
		return execute(MsgFuncExt.FUNC_UPDATE_ALERT_CFG,CONN_T_TCP);
	}
}
